// 应用常量定义

// 应用信息
export const APP_INFO = {
  name: 'Modern SSH Client',
  version: '1.0.0',
  description: '现代化SSH连接工具',
  author: 'Your Name',
  repository: 'https://github.com/your-username/modern-ssh-client',
} as const;

// 导航配置
export const NAVIGATION_ITEMS = [
  {
    id: 'connections',
    label: '连接管理',
    icon: '📡',
    path: '/connections',
    shortcut: 'Ctrl+1',
  },
  {
    id: 'terminal',
    label: '终端会话',
    icon: '🖥️',
    path: '/terminal',
    shortcut: 'Ctrl+2',
  },
  {
    id: 'files',
    label: '文件管理',
    icon: '📁',
    path: '/files',
    shortcut: 'Ctrl+3',
  },
  {
    id: 'ai',
    label: 'AI助手',
    icon: '🤖',
    path: '/ai',
    shortcut: 'Ctrl+4',
  },
  {
    id: 'settings',
    label: '系统设置',
    icon: '⚙️',
    path: '/settings',
    shortcut: 'Ctrl+5',
  },
] as const;

// 主题配置
export const THEMES = {
  light: {
    name: '浅色主题',
    colors: {
      primary: '#1890ff',
      secondary: '#722ed1',
      success: '#52c41a',
      warning: '#faad14',
      error: '#ff4d4f',
      info: '#1890ff',
      background: '#ffffff',
      surface: '#f5f5f5',
      text: '#262626',
      textSecondary: '#8c8c8c',
      border: '#d9d9d9',
    },
  },
  dark: {
    name: '深色主题',
    colors: {
      primary: '#177ddc',
      secondary: '#642ab5',
      success: '#49aa19',
      warning: '#d89614',
      error: '#d32029',
      info: '#177ddc',
      background: '#141414',
      surface: '#1f1f1f',
      text: '#ffffff',
      textSecondary: '#a6a6a6',
      border: '#434343',
    },
  },
} as const;

// 窗口配置
export const WINDOW_CONFIG = {
  minWidth: 800,
  minHeight: 600,
  defaultWidth: 1200,
  defaultHeight: 800,
  sidebarMinWidth: 160,
  sidebarMaxWidth: 320,
  sidebarDefaultWidth: 240,
  statusBarHeight: 24,
} as const;

// 快捷键配置
export const SHORTCUTS = {
  // 导航快捷键
  navConnections: 'Ctrl+1',
  navTerminal: 'Ctrl+2',
  navFiles: 'Ctrl+3',
  navAI: 'Ctrl+4',
  navSettings: 'Ctrl+5',
  
  // 窗口快捷键
  toggleSidebar: 'Ctrl+B',
  toggleFullscreen: 'F11',
  
  // 应用快捷键
  newConnection: 'Ctrl+N',
  quickConnect: 'Ctrl+K',
  save: 'Ctrl+S',
  find: 'Ctrl+F',
  settings: 'Ctrl+,',
  
  // 系统快捷键
  minimize: 'Ctrl+M',
  close: 'Ctrl+W',
  quit: 'Ctrl+Q',
} as const;

// 文件类型配置
export const FILE_TYPES = {
  image: ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'svg', 'webp'],
  video: ['mp4', 'avi', 'mov', 'wmv', 'flv', 'webm'],
  audio: ['mp3', 'wav', 'flac', 'aac', 'ogg'],
  document: ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx'],
  text: ['txt', 'md', 'json', 'xml', 'yaml', 'yml', 'ini', 'conf'],
  code: ['js', 'ts', 'jsx', 'tsx', 'html', 'css', 'scss', 'less', 'py', 'java', 'cpp', 'c', 'go', 'rs'],
  archive: ['zip', 'rar', '7z', 'tar', 'gz', 'bz2'],
} as const;

// 连接配置
export const CONNECTION_CONFIG = {
  defaultPort: 22,
  timeout: 30000,
  maxRetries: 3,
  retryDelay: 5000,
  keepAliveInterval: 60000,
} as const;

// 文件传输配置
export const FILE_TRANSFER_CONFIG = {
  chunkSize: 8192,
  maxConcurrentTransfers: 3,
  retryAttempts: 3,
  retryDelay: 1000,
} as const;

// AI配置
export const AI_CONFIG = {
  maxTokens: 1000,
  temperature: 0.7,
  maxHistoryLength: 20,
  typingDelay: 50,
} as const;

// 日志配置
export const LOG_CONFIG = {
  level: 'info',
  maxFileSize: '10MB',
  maxFiles: 5,
  datePattern: 'YYYY-MM-DD',
} as const;

// 错误代码
export const ERROR_CODES = {
  // 连接错误
  CONNECTION_FAILED: 'CONNECTION_FAILED',
  CONNECTION_TIMEOUT: 'CONNECTION_TIMEOUT',
  AUTHENTICATION_FAILED: 'AUTHENTICATION_FAILED',
  
  // 文件错误
  FILE_NOT_FOUND: 'FILE_NOT_FOUND',
  FILE_UPLOAD_FAILED: 'FILE_UPLOAD_FAILED',
  FILE_DOWNLOAD_FAILED: 'FILE_DOWNLOAD_FAILED',
  PERMISSION_DENIED: 'PERMISSION_DENIED',
  
  // 应用错误
  CONFIG_LOAD_FAILED: 'CONFIG_LOAD_FAILED',
  CONFIG_SAVE_FAILED: 'CONFIG_SAVE_FAILED',
  WINDOW_CREATE_FAILED: 'WINDOW_CREATE_FAILED',
  
  // AI错误
  AI_REQUEST_FAILED: 'AI_REQUEST_FAILED',
  AI_RESPONSE_INVALID: 'AI_RESPONSE_INVALID',
  
  // 通用错误
  UNKNOWN_ERROR: 'UNKNOWN_ERROR',
  INVALID_ARGUMENT: 'INVALID_ARGUMENT',
  OPERATION_CANCELLED: 'OPERATION_CANCELLED',
} as const;

// 事件名称
export const EVENT_NAMES = {
  // 窗口事件
  WINDOW_MAXIMIZED: 'window-maximized',
  WINDOW_UNMAXIMIZED: 'window-unmaximized',
  WINDOW_FOCUSED: 'window-focused',
  WINDOW_BLURRED: 'window-blurred',
  
  // 连接事件
  CONNECTION_ESTABLISHED: 'connection-established',
  CONNECTION_LOST: 'connection-lost',
  CONNECTION_ERROR: 'connection-error',
  
  // 文件传输事件
  TRANSFER_STARTED: 'transfer-started',
  TRANSFER_PROGRESS: 'transfer-progress',
  TRANSFER_COMPLETED: 'transfer-completed',
  TRANSFER_FAILED: 'transfer-failed',
  
  // 主题事件
  THEME_CHANGED: 'theme-changed',
  
  // 导航事件
  NAVIGATION_CHANGED: 'navigation-changed',
} as const;